<%@ Page Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true" CodeFile="EjecucionAvanceListado.aspx.cs" Inherits="EjecucionAvanceListado" Title="Untitled Page" %>
<%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc2" %>

<%@ Register Assembly="UsrControls" Namespace="UsrControls" TagPrefix="cc1" %>
<%@ Register Assembly="Anthem" Namespace="Anthem" TagPrefix="anthem" %>
    
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  <script language="javascript" type="text/javascript">
    function OnGridSelectionChanged() {
    var counter = document.getElementById("selCount");
    if(counter != null) 
    setInnerText(counter, ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedRowCount().toString());
    
    ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedFieldValues('PRG_NOMBRE', OnGridSelectionComplete);
}
function OnGridSelectionComplete(values) {
    selList.BeginUpdate();
    selList.ClearItems();
    for(var i = 0; i < values.length; i ++) {
        selList.AddItem(values[i]);
    }
    selList.EndUpdate();
}
function setInnerText(element, text) { 
    if(typeof element.textContent != 'undefined') { 
        element.textContent = text; 
    } 
    else if (typeof element.innerText != 'undefined') { 
        element.innerText = text; 
    } 
    else if (typeof element.removeChild != 'undefined') { 
        while (element.hasChildNodes()) { 
            element.removeChild(element.lastChild); 
        } 
        element.appendChild(document.createTextNode(text)); 
    } 
}

function confirmEdit()
{
var counter = ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedRowCount();

if (counter > 1)
    {
    counter = 0;
        alert("Debe seleccionar un solo registro");
        return(false);
    }
    else if (counter == 1)
    {
    counter = 0;
        return(true);
    }
    else if (counter == 0)
    {
    counter = 0;
    alert("Debe seleccionar al  menos un registro");
        return(false);
    }
}
function delete_PreCallBack(button) 
{
var counter = ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedRowCount();

if (counter > 0)
    {
        return confirm ('Esta seguro de eliminar los registros seleccionados?')
    }
  alert("Debe seleccionar por lo menos un registro");
    return(false);
  
}

function confirmDelete () 
{ 
		var frm;
		
		if (arguments.length > 0)
		{
			frm = arguments[0];
		}
		else
		{
			frm =document.forms[0];
		}



    // loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        // Look for our checkboxes only
        if (frm.elements[i].name.indexOf("chkId") !=-1) 
        {
            // If any are checked then confirm alert, otherwise nothing happens
            if(frm.elements[i].checked) 
            {
                return confirm ('Esta seguro de eliminar los registros seleccionados?')
            }
        }
    }
    alert("Debe seleccionar por lo menos un registro");
    return(false);
}
    </script>
                      <h1 class="planes">Avances Metas</h1>

                <anthem:Label ID="lblMensaje" runat="server" AutoUpdateAfterCallBack="True" UpdateAfterCallBack="True"></anthem:Label>
                <anthem:TextBox ID="txtidUsuario" runat="server" AutoUpdateAfterCallBack="True" Visible="False">8</anthem:TextBox>
       <div class="borde">
                <table width="100%" class="content-box">
                    <tr>
                        <td colspan="4" class="box-header"><h2>
                            <asp:Label ID="lblDependencia" runat="server"></asp:Label></h2></td>
                            </tr>
                            <tr><td style="width: 10%">
                                        Rubro</td>
                                    <td colspan="3">
                                        <asp:LinkButton ID="lblDescripcionRubro" runat="server" CausesValidation="False" OnClick="lblDescripcionRubro_Click"></asp:LinkButton></td>
                                </tr>
                                <tr>
                                <td style="width: 10%">
                                        Actividad</td>
                                    <td><asp:LinkButton ID="lblAccion" runat="server" OnClick="lblAccion_Click"></asp:LinkButton></td>
                                    <td>
                                        VALOR APROPIACION</td>
                                    <td>
                                        <asp:Label ID="lblValorApropiacion" runat="server"></asp:Label></td>
                                </tr>
                                <tr>                          
                                    <td>
                                        Valor</td>
                                    <td><asp:Label ID="lblValorAccion" runat="server" ></asp:Label></td>
                                
                                    <td>
                                        Meta</td>
                                    <td >
                                        &nbsp;<asp:LinkButton ID="lblMeta" runat="server" OnClick="lblMeta_Click"></asp:LinkButton></td>
                                </tr>
                                <tr>
                                    <td>
                                        Unidad</td>
                                    <td>
                                        <asp:Label ID="lblUnidad" runat="server"></asp:Label></td>
                                    <td>
                                        Programado</td>
                                    <td>
                                        &nbsp;<asp:Label ID="lblProgramado" runat="server"></asp:Label></td>
                                </tr>
                            </table>
                            </div>
                <div class="toolbar">
                <cc1:WccAcciones ID="WccAcciones1" runat="server" AddCausesValidation="False" AddEnableCallBack="False"
                    ArchiveVisible="False" AuditVisible="False" DeclineVisible="False" DeleteEnableCallBack="True"
                    DeletePreCallBackFunction="delete_PreCallBack" OnAdd_OnClick="WccAcciones1_Add_OnClick"
                    OnDelete_OnClick="WccAcciones1_Delete_OnClick" OnUpdate_OnClick="WccAcciones1_Update_OnClick"
                    PublishVisible="False" UpdateCausesValidation="False" UpdateEnableCallBack="False"
                    UpdateOnClickFunction="return confirmEdit();" ValidateVisible="False" />
                    </div>        
                <table class="tabs">
                    <tr>
                        <td class="tab-inactivo">
                            <anthem:LinkButton ID="lnkPlanPrograma" runat="server" CausesValidation="False" EnableCallBack="False" OnClick="lnkPlanPrograma_Click">Plan Programa</anthem:LinkButton></td>
                        <td id="td2" runat="server" class="tab-activo"  visible="true">
                            <anthem:LinkButton ID="lnkEjecucion" runat="server" CausesValidation="False"
                                EnableCallBack="False" Enabled="False">EJECUCION</anthem:LinkButton></td>
                        <td id="td3" runat="server" class="tab-inactivo" visible="true">
                            <anthem:LinkButton ID="LnkCofinanciacion" runat="server" CausesValidation="False"
                                EnableCallBack="False" Enabled="true" OnClick="LnkCofinanciacion_Click">COFINANCIACION</anthem:LinkButton></td>
                        <td id="td4" runat="server" class="tab-inactivo" visible="false">
                            <anthem:LinkButton ID="lnkPublicacionesRelevantes" runat="server" CausesValidation="False"
                                EnableCallBack="False" Enabled="true">Otros</anthem:LinkButton></td>
                    </tr>
                </table>

            <anthem:Panel ID="Panel1" runat="server" AutoUpdateAfterCallBack="True" Width="100%">
                <dxwgv:ASPxGridView ID="gridEjecucion" runat="server" AutoGenerateColumns="False"
                    CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" CssPostfix="PlasticBlue"
                    KeyFieldName="SPZE_ID"
                    Width="100%" Theme="PlasticBlue">
                    
                    <Settings ShowFilterRow="True" ShowFilterRowMenu="True" />
                    <Styles CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" CssPostfix="PlasticBlue">
                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                        </Header>
                    </Styles>
                    
                    <Columns>
                        <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                            <ClearFilterButton Visible="True">
                            </ClearFilterButton>
                        </dxwgv:GridViewCommandColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Descripci&#243;n" FieldName="PRG_DESCRIPCION"
                            VisibleIndex="1" Width="250px">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Municipio" FieldName="ZON_NOMBRE" VisibleIndex="2">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="A&#241;o" FieldName="PRG_ANO" VisibleIndex="3"
                            Width="50px">
                            <HeaderStyle Wrap="True" />
                            <CellStyle Wrap="True">
                            </CellStyle>
                            <FooterCellStyle Wrap="True">
                            </FooterCellStyle>
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Poblaci&#243;n" FieldName="PRG_POBLACION_BENEFICIADA"
                            VisibleIndex="4" Width="50px">
                            <PropertiesTextEdit DisplayFormatString="{0:N0}">
                            </PropertiesTextEdit>
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Valor" FieldName="PRG_VALOR_EJECUCION" VisibleIndex="5"
                            Width="100px">
                            <PropertiesTextEdit DisplayFormatString="{0:N2}">
                            </PropertiesTextEdit>
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Observaciones" FieldName="PRG_OBSERVACIONES"
                            VisibleIndex="6">
                        </dxwgv:GridViewDataTextColumn>
                    </Columns>
                    <SettingsPager ShowDefaultImages="False">
                        <AllButton Text="Todos">
                        </AllButton>
                        <NextPageButton Text="Siguiente &gt;">
                        </NextPageButton>
                        <PrevPageButton Text="&lt; Anterior">
                        </PrevPageButton>
                    </SettingsPager>
                </dxwgv:ASPxGridView>
                </anthem:Panel>
            

</asp:Content>

